cssprovider: Handle non-existing section
authorBenjamin Otte <otte@redhat.com>
Thu, 15 Nov 2012 18:18:19 +0000 (19:18 +0100)
committerBenjamin Otte <otte@redhat.com>
Thu, 15 Nov 2012 18:25:14 +0000 (19:25 +0100)
Otherwise we'll get warnings on errors when CSS debug is disabled.

gtk/gtkcssprovider.c

index 8be9d23d9fd4e4342e25e76a998c66b2e287d269..98a44575c75ca7609b622ca84c5a338fe6954d59 100644 (file)
@@ -1825,9 +1825,12 @@ gtk_css_provider_propagate_error (GtkCssProvider  *provider,
     return;
 
   *propagate_to = g_error_copy (error);
-  s = _gtk_css_section_to_string (section);
-  g_prefix_error (propagate_to, "%s", s);
-  g_free (s);
+  if (section)
+    {
+      s = _gtk_css_section_to_string (section);
+      g_prefix_error (propagate_to, "%s", s);
+      g_free (s);
+    }
 }
 
 static gboolean